package com.cn.thread.disruptor.chain.translate;

import com.cn.thread.disruptor.domain.Trade;
import com.lmax.disruptor.EventTranslator;

import java.util.Random;

public class TradeEventTranslator implements EventTranslator<Trade> {

    private Random random = new Random();
    @Override
    public void translateTo(Trade trade, long l) {
        trade.setPrice(random.nextDouble() * 9999);
    }
}
